package com.wosai.register.util;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Collection;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.wosai.register.model.Categories;
import com.wosai.register.model.Employees;
import com.wosai.register.model.Orders;
import com.wosai.register.model.Products;
import com.wosai.register.model.Terminal;


public class TestJsonMapper {
    
    /**
     * @param args
     */
    public static void main(String[] args) throws IOException {
        if(args.length!=1){
            System.err.println("Usage: $0 file.json");
            return;
        }
        InputStream is = new FileInputStream(args[0]);
        
        ObjectMapper mapper = new ObjectMapper();  
        Object object = mapper.readValue(is, Products.class);
        
        System.out.println(mapper.writeValueAsString(object));  
    }

}

